#include "Exception.h"
#include "lang/String.h"

namespace yzrilyzr_lang{
	Exception::Exception(const String & message) : msg_(message.c_str()){
		std::cout << "Exception build: msg: " << message << std::endl;
	}
	ArrayIndexOutOfBoundsException::ArrayIndexOutOfBoundsException(u_index index) :
		Exception(String("Array index out of range: " + std::to_string(index))){}
	NumberFormatException NumberFormatException::forInputString(const String &s, int32_t radix){
		return NumberFormatException(String("For input string: \"") + s + "\"" +
									 (radix == 10?
									  "":
									  String(" under radix ") + radix));
	}
}